
<#include "/base/common/head.html"/>


 <div class="easyui-panel addPage multiple" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
            <tr>
           		<th><span>key</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="key" id="key" value="" data-options="required:true,fit: true" tabindex="1" addClear></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>名称</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="name" id="name" value="" data-options="required:true,fit: true" tabindex="2" addClear></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>备注</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-textbox" type="text" name="remark" id="remark" value="" data-options="fit: true" tabindex="3" addClear></input></div>
           		</td>
            </tr>
            <tr>
           		<th><span>排序号</span></th>
               	<td>
               		<div class="wrap_input"><input class="easyui-numberbox" type="text" name="orderNum" id="orderNum" value="" tabindex="4" addClear data-options="fit: true "></input></div>
           		</td>
            </tr>
           
        </table>
    </form>
</div>
<script>
top.window.subPage.save = save;
function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("add", getParam(), function(data) {
			if("01" == data.code){//成功
				top.window.closeWindow(); //关闭窗口
				top.window.subPage.loadCurrDatagrid(); //回调方法
				showMsg(data.msg); //显示消息
				
			}else if("04" == data.code){//失败
				showErrorMsg(data.msg); //显示错误消息
			}
			
		});
		
	}
}
function getParam() {
	var param = {
       		"obj.name": getInputValue("name"), 
       		"obj.key": getInputValue("key"), 
       		"obj.remark": getInputValue("remark"), 
       		"obj.orderNum": getInputValue("orderNum")
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

$(function(){
		autoAddClear(); //为各组件自动填加‘清除’功能（组件需要增加 addClear属性 ）
		addChangeFocusOpe(); //页面增加焦点切换操作
		$('#key').next('span').find('input').focus();  //第一个元素设置焦点 
	});

</script>
<#include "/base/common/foot.html"/>
